package concurrency.part1.task3;

public class Producer implements Runnable {
    private final Buffer<Object> buffer;
    private final String name;

    public Producer(String name, Buffer<Object> buffer) {
        this.buffer = buffer;
        this.name=name;
    }

    @Override
    public void run() {
        Object product=null;
        while (!Thread.currentThread().isInterrupted()) {
            product=new Object();
            buffer.add(product);
        }
    }
}
